-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BWAP-806 updating paginator component to hand textField properties #1242
base: master
Are you sure you want to change the base?
Conversation
@@ -242,6 +246,7 @@ class Paginator extends React.Component<IPaginatorProps, IPaginatorState> { | |||
event: React.FocusEvent | React.FormEvent; | |||
} | |||
): void => { | |||
console.log(pageNum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to remove the log statement here unless it's intentional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
onBlur={this.handleTextFieldChange} | ||
onSubmit={this.handleTextFieldChange} | ||
isDisabled={isDisabled} | ||
isDisabled={isDisabled || textFieldProps.isDisabled} | ||
{...textFieldProps} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change of order would result in textFieldProps.isDisabled taking precedence over isDisabled.
if not intentional change, would leave the spread operator on the line above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good callout. Updated and added a test case as an example for this.
@@ -11,7 +11,10 @@ import { | |||
SingleSelectDumb as SingleSelect, | |||
ISingleSelectState, | |||
} from '../SingleSelect/SingleSelect'; | |||
import TextField, { ITextFieldProps } from '../TextField/TextField'; | |||
import TextField, { | |||
ITextFieldProps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: are both ITextFieldProps/ITextFieldPropsWithPassThroughs still used? else can be removed from the imports
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed with ITextFieldPropsWithPassThroughs
@@ -35,6 +38,10 @@ type IPaginatorSingleSelectProps = Partial<ISingleSelectProps>; | |||
|
|||
type ShowTotalObjects = (count: number) => string; | |||
|
|||
interface IExtendedTextFieldProps extends Omit<ITextFieldProps, 'value'> { | |||
value?: string | number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this being done just to allow number
as a type on value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to only allow string as an optional value
}} | ||
TextField={{ | ||
value: 3, | ||
isDisabled: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless covered by another storybook example - also include an example if isDisabled: false
(assume it is covered as the default value)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Covered by new storybook example
onBlur={this.handleTextFieldChange} | ||
onSubmit={this.handleTextFieldChange} | ||
isDisabled={isDisabled} | ||
isDisabled={isDisabled || textFieldProps.isDisabled} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this be covered in a test case?
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
merge master
BWAP-806 update to master
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What specific problem in the UI is this change trying to solve, what's the use case? I'm just curious because this component has been around for a long time without this modification.
@@ -27,6 +27,10 @@ type IPaginatorSingleSelectProps = Partial<ISingleSelectProps>; | |||
|
|||
type ShowTotalObjects = (count: number) => string; | |||
|
|||
interface IExtendedTextFieldProps extends Omit<ITextFieldProps, 'value'> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to redefine the value field?
PR Checklist
Storybook can be viewed here:
Manually tested across supported browsers
[ x] Unit tests written (
common
at minimum)[ x] PR has one of the
semver-
labelsTwo core team engineer approvals
One core team UX approval